import VueRouter from "vue-router"

import Login from "@/components/Login.vue"
import MainPage from "@/views/MainPage.vue"
import UserInfo from "@/components/UserInfo.vue"
import UpdatePwd from "@/components/UpdatePwd.vue"
import ClassMana from "@/views/Mana/ClassMana.vue"
import CourseScore from "@/views/CourseScore.vue"
import ScoreMana from "@/views/Mana/ScoreMana.vue"
import CourseMana from "@/views/Mana/CourseMana.vue"
import TeachMana from "@/views/Mana/TeachMana.vue"
import AccountMana from "@/views/Mana/AccountMana.vue"
import ScoreAnalysis from "@/views/ScoreAnalysis.vue"
import { Message } from "element-ui"
export default new VueRouter({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/mainPage',
      name: 'mainPage',
      component: MainPage,
      meta: { isAuth: true },
      redirect: '/mainPage/userInfo',
      children: [
        {
          path: 'userInfo',
          name: '基本信息',
          component: UserInfo
        },
        {
          path: 'updatePwd',
          name: '修改密码',
          component: UpdatePwd
        },
        {
          path: 'classMana',
          name: '选课管理',
          component: ClassMana
        },
        {
          path: 'courseScore',
          name: '课程成绩',
          component: CourseScore
        },
        {
          path: 'scoreMana',
          name: '成绩管理',
          component: ScoreMana
        },
        {
          path: 'courseMana',
          name: '课程管理',
          component: CourseMana
        },
        {
          path: 'scoreAnalysis',
          name: '成绩分析',
          component: ScoreAnalysis
        },
        {
          path: 'teachMana',
          name: '教学管理',
          component: TeachMana
        },
        {
          path: 'accountMana',
          name: '账号管理',
          component: AccountMana
        }
      ]
    }
  ]
})